﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Locator.LcboServices.LcboInventoryService.Services;
using Locator.LcboServices.PageLoaders.Services;
using LcboServices.Common.Tests;
using Locator.LcboServices.BusinessEntities;

namespace LcboInventoryService.Tests
{
    [TestFixture]
    public class Tests
    {
        [Test]
        public void RetrieveMatches3Test()
        {
            using (LcboInventoryServiceAgent agent = new LcboInventoryServiceAgent(new LocalFilePageRetrieverFactory()))
            {
                List<int> productIds = new List<int> { 198069, 904409, 12345 };
                List<LcboInventoryData2> inventory = agent.RetrieveMatches(productIds);
                Assert.AreEqual(667, inventory.Count);
                Assert.AreEqual(198069, inventory[0].ProductId);
                Assert.AreEqual(22, inventory[0].NumberInStock);
                Assert.AreEqual("Windsor", inventory[0].City);
                Assert.AreEqual("3165 Howard Avenue", inventory[0].StreetAddress);
                Assert.AreEqual(367, inventory[0].StoreNumber);
                Assert.AreEqual("3165 Howard Avenue Windsor ON", inventory[0].FullAddress);
                Assert.AreEqual(12345, inventory[666].ProductId);
                Assert.AreEqual(1, inventory[666].NumberInStock);
                Assert.AreEqual("Scarborough", inventory[666].City);
                Assert.AreEqual("5979 Steeles Avenue East", inventory[666].StreetAddress);
                Assert.AreEqual(703, inventory[666].StoreNumber);
                Assert.AreEqual("5979 Steeles Avenue East Scarborough ON", inventory[666].FullAddress);
            }
        }
    }
}
